<%@ page language="java"  pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<div class=" tc_title">
	<a href="javascript:void(0)" class="tc_close"><img src="images/other/icon_29.jpg" />
	</a>修改用户
</div>
<div class="tc_content">
	<div class=" com_tit_con fl">
		<h3>
			修改用户
		</h3>
		<table class="tc_table">
			
			<tr>
				<td width="80">
					用户ID
					<font color="red">*</font>
				</td>
				<td>
					<input type="text" class="com_txt" id="editschoolcode" readonly="readonly" value="<s:property value="#request.user.id"/>"/>
				</td>
			</tr>
			<tr>
				<td width="80">
					姓名
					<font color="red">*</font>
				</td>
				<td>
					<input type="text" class="com_txt" id="editusername" value="<s:property value="#request.user.username"/>"/>
				</td>
			</tr>
			<tr>
				<td width="80">
					单位
					<font color="red">*</font>
				</td>
				<td>
					<input type="text" class="com_txt" id="editschoolName" value="<s:property value="#request.user.schoolName"/>"/>
				</td>
			</tr>
			<tr>
				<td width="80">
					手机
					<font color="red">*</font>
				</td>
				<td>
					<input type="text" class="com_txt" id="editmobile" value="<s:property value="#request.user.mobile"/>"/>
				</td>
			</tr>
			<tr>
				<td width="80">
					邮件
				</td>
				<td>
					<input type="text" class="com_txt" id="editemail" value="<s:property value="#request.user.email"/>"/>
				</td>
			</tr>

			<tr>
				<td width="80"></td>
				<td>
					<input type="button" class="def_btn_s1" value="修 改"
						onclick="editUser();" />
				</td>
			</tr>
		</table>
	</div>


	<div class="clear"></div>

</div>

<script type="text/javascript">
		function editUser(){
			
    		var schoolCode = $("#editschoolcode").val();
    		var username = $("#editusername").val();
    		var mobile = $("#editmobile").val();
    		var schoolName = $("#editschoolName").val();
    		var email = $("#editemail").val();
    		if(schoolCode == null || schoolCode == ""){
    			alert("用户ID不能为空！");
    			return false;
    		}
    		if(username == null || username == ""){
    			alert("姓名不能为空！");
    			return false;
    		}
    		if(schoolName == null || schoolName == ""){
    			alert("单位不能为空！");
    			return false;
    		}
    		if(mobile == null || mobile == ""){
    			alert("手机不能为空！");
    			return false;
    		}
    		$.post("member!saveEditUser.do",{
    			'member.schoolCode':schoolCode,
    			'member.username':username,
    			'member.mobile':mobile,
    			'member.schoolName':schoolName,
    			'member.email':email
    		},function(data){
    			if(data!=null){
    				var ret = $.parseJSON(data);
    				if(ret.success == 'true'){
    					$("#edit_user").hide();
						$("div.zz_box").hide();
    					searchUser();
    				}else{
    					alert(ret.msg);
    				}
    			}
    		});
		}

</script>